<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    var aNumber=[10,23,2,4,6,8,26,43,66,33,90,75];
    function maopao(arr){
        var temp=0;
        for(var i=0;i<=arr.length-1;i++){
//            console.log(i)//0-11 循环12次
            for(var j=0;j<=arr.length-1-i;j++){
//                console.log(j)
                if(arr[j]<arr[j+1]){ //升序改为>
                    temp = arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
        return arr;

    }
    alert(maopao(aNumber))
//    冒泡的js方法的特点，两个循环，设置一个中间变量
</script>
</body>
</html>